package net.wofly.sale.order.service.impl;

import net.wofly.sale.order.domain.ReturnSalesContent;
import net.wofly.sale.order.repository.ReturnSalesContentRepository;
import net.wofly.sale.order.service.IReturnSalesContentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;
import java.util.List;

@Service("iReturnSalesContentService")
@Transactional
public class ReturnSalesContentServiceImpl implements IReturnSalesContentService {
    
    @Autowired
    ReturnSalesContentRepository returnSalesContentRepository;
    
    @Override
    public ReturnSalesContent save(ReturnSalesContent entity) {
        return returnSalesContentRepository.save(entity);
    }
    
    @Override
    public void delete(ReturnSalesContent entity) {
        returnSalesContentRepository.delete(entity);
    }
    
    @Override
    public void delete(String key) {
        returnSalesContentRepository.delete(key);
    }
    
    @Override
    public void deleteByReturnSalesID(String returnSalesID) {
        returnSalesContentRepository.deleteByReturnSalesID(returnSalesID);
    }
    
    @Override
    public ReturnSalesContent findOne(String key) {
        return returnSalesContentRepository.findOne(key);
    }
    
    @Override
    public List<ReturnSalesContent> save(List<ReturnSalesContent> entityList) {
        return (List<ReturnSalesContent>) returnSalesContentRepository.save(entityList);
    }
}
